package com.ocm.product.feign;

import lombok.AllArgsConstructor;
import com.ocm.core.tool.api.R;
import com.ocm.order.dto.OrderDetailDTO;
import com.ocm.product.entity.Spu;
import com.ocm.product.service.ISpuService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * Author:   hqy
 * Date:     2021/12/3 12:52
 * Description:
 */
@ApiIgnore
@RestController
@AllArgsConstructor
public class SpuClient implements ISpuClient{

	ISpuService iSpuService;

	@Override
	@GetMapping(API_PREFIX + "/getSpu")
	public R<Spu> getSpu(Long id) {
		return R.data(iSpuService.getById(id));
	}

	@Override
	public R<OrderDetailDTO> getOrderData(Long skuId) {
		return R.data(iSpuService.getOrderData(skuId));
	}
}
